using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using GameObjectsAndEquipment;

namespace Rendering
{
    public class Renderer
    {
        private GraphicsDeviceManager graphics;
        private SpriteBatch spriteBatch;
        private SpriteFont font;
        private Texture2D fooTexture;

        public SpriteFont Font
        {
            get { return font; }
            set { font = value; }
        }

        public Renderer(GraphicsDeviceManager graphics, SpriteBatch spriteBatch)
        {
            this.graphics = graphics;
            this.spriteBatch = spriteBatch;

            fooTexture = new Texture2D(graphics.GraphicsDevice, 1, 1);
            fooTexture.SetData(new Color[] { Color.White });
        }

        public void DrawSprite(Sprite sprite)
        {
            spriteBatch.Begin();
             spriteBatch.Draw(sprite.Texture, sprite.Position, Color.White);
            spriteBatch.End();
        }

        public void DrawText(TextObject textObject, SpriteFont font)
        {
            spriteBatch.Begin();
            spriteBatch.DrawString(font,textObject.Text,textObject.Position,textObject.Color);
            spriteBatch.End();
        }

        public void ClearScreen(Color color)
        {
            graphics.GraphicsDevice.Clear(color);
        }

        public void DrawRectangle(Rectangle rectangle, Color color)
        {
            spriteBatch.Begin();
            spriteBatch.Draw(fooTexture, rectangle, color);
            spriteBatch.End();
        }

    }
}
